e
#Title[ʏ8]
#Text[eIE퉻w
ʏ8]
#BackGround[User]
#BGM[.\..\bgm\bgm.wav]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main {
	
	////////////////////////////////////////////////////////////////////////
	//                                                          //
	//   ȂBAȂȂ̏oƎv܂B                     //
	////////////////////////////////////////////////////////////////////////
	
	@Initialize{
		InitializeData();
		
		LoadUserShotData(shot_ryoyan);
		
		SetLife(4000);
		SetDamageRate(120,100);
		SetMovePosition03(GetCenterX(),150,10,8);
		SetInvincibility(120);
		SetCollisionEx(32,16);
		SetEnemyMarker(true);
		
		TMain();
	}
	
	@MainLoop{
		yield;
	}
	
	@DrawLoop{
		DrawBoss(imgBoss);
	}
	
	@Finalize{
		FinalizeData();
	}
	
	task TMain(){
		wait(120);
		
		SetTimer(60);
		
		Atack();
		Move();
	}
	
	task Atack(){
		let count=0;
		let color=[_RED21L(),_GREEN21L(),_BLUE21L()];
		
		wait(60);
		
		loop{
			let ang=GetAngleToPlayer();
			let x=GetX();
			let y=GetY();
			let id2=CreateShotObj(x,y,0,ang,_WHITE03(),0);
			AA_Homing(id2,7,80);
			AA_TimeDelete(id2,70+70-60,true);
			ascent(i in 0..30) {
				let ang2=i*p1m0(count)*12;
				ascent(ii in 0..3) {
					let id=CreateLaserObjA(x,y,ang+ang2,200,20+ii*3,color[(ii+i+count)%3],30,false);
					Obj_SetAlpha(id,127);
					ksk(id,id2,10-ii,-0.02,ang2,60-i);
					AA_LaserCloseAB(id,60-i+70,20);
				}
				yield;
			}
			wait(30);
			count++;
		}
	}
	
	task ksk(let id,let id2,let spd,let spdpl,let ang,let time) {
		loop(time){
			Obj_SetAngle(id,Obj_GetAngle(id2)+ang);
			yield;
		}
		ascent(i in 0..90){
			ObjLaser_SetLength(id,200+i*spd);
			spd+=spdpl;
			yield;
		}
	}
	
	task Move(){
		move02(GetCenterX(),GetCenterY()-110,120+30,70,70,50);
	}
	
	#include_function ".\..\functions\initialize.txt"
	#include_function ".\..\functions\color_set.txt"
	#include_function ".\..\functions\function.txt"
}
